/**
 * Copyright (C), 2019-2022, 宇信融汇
 * FileName: Computer
 * Author:   666
 * Date:     2022/1/15 20:25
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 666           修改时间           版本号              描述
 */
package com.polymorphic;

/**
 * @Classname Computer
 * @Description TODO
 * @Date 2022/1/15 20:25
 * @Created by 666
 */
public class Computer {
    private String name;

    public Computer(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void run() {
        System.out.println(this.name + "启动了");
    }

    public void installUsb(Usb usb) {
        usb.connect();
        if (usb instanceof Mouse) {
            Mouse m = (Mouse) usb;
            m.dbClick();
        }
        usb.unConnect();
    }
}
